<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Blog</title>
<style type="text/css">
    *{padding:0;margin:0;}
    body{width:600px;margin:2em auto;padding:0 2em;font-size:14px;font-family:"Microsoft YaHei";}
    p{line-height:24px;margin:1em 0;}header{padding:.5em 0;border-bottom:1px solid #cccccc;}
    nav{float:left;font-family:"Microsoft YaHei";font-size:1.1em;text-transform:uppercase;margin-left:-12em;width:9em;text-align:right;}
    nav a{display:block;text-decoration:none;padding:.7em 1em;color:#000000;}
    nav a:hover{background-color:#ff0000;color:#f9f9f9;-webkit-transition:color .2s linear;}
    article{font-size:16px;padding-top:.5em;}article a{color:#dd0000;text-decoration:none;}
    article a:hover{color:#333333;text-decoration:underline;}.info{font-size:14px;}
</style>
</head>
<body>
<header>
<h1><%= title %></h1>
</header>
<nav>
<span><a title="主页" href="/">home</a></span>
<% if(locals.user){ %>
  <span><a title="发表" href="/post">post</a></span>
  <span><a title="登出" href="/logout">logout</a></span>
<% } else { %>
  <span><a title="登录" href="/login">login</a></span>
  <span><a title="注册" href="/reg">register</a></span>
<% } %>
</nav>
<article>
<% if (locals.success) { %>
  <div ><%= locals.success %></div>
<% } %>
<% if (locals.error) { %>
  <div><%= locals.error %> </div>
<% } %>